import sys
import numpy as np
import matplotlib.pyplot as plt

def main():
    num = sys.argv[1]
    
    x = np.arange(1)
    plt.ylabel('Time (us)')
    bar_width=0.1

    for i in range(0, int(num)):
        with open(str(i) + 'inDevice4.dat', 'r') as t:
            while True:
                times = t.readline()
                if times == '':
                    break

                y = []
                for s in times.split(' '):
                    y.append(float(s))

                plt.bar(x + bar_width * i - 0.1, y, bar_width, label = i)

    # plt.legend()
    plt.show()

if __name__ == '__main__':
    main()
